package com.b2b.common.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by Soldier lee on 2016-11-09.
 */
public class AppException extends RuntimeException  {
    private static Logger log = LoggerFactory.getLogger(AppException.class);

    /**
     * 直接打印简单信息
     *
     * @param pMsg
     */
    public AppException(String pMsg) {
        super(pMsg);
        log.error(pMsg);
    }

    /**
     * 直接打印简单信息和异常堆栈
     *
     * @param pMsg
     * @param pNestedException
     */
    public AppException(String pMsg, Throwable pNestedException) {
        super(pMsg);
        pNestedException.printStackTrace();
    }

    /**
     * 直接打印异常堆栈
     *
     * @param pNestedException
     */
    public AppException(Throwable pNestedException) {
        super(pNestedException);
        pNestedException.printStackTrace();
    }
}
